package com.cskaoyan._06oop3._05innerclass._01demo;

/**
 * @author Macro_Ray
 * @since 2024/3/14 19:50
 */
// 外部类
public class Car {
    String carName;
    int carAge;
    String carColor;

    public void show(){
        System.out.println(carName);
        //System.out.println(engineName);

        // 没有发动机的对象  需要创建内部类对象
        Engine engine = new Engine();
        System.out.println(engine.engineName);
    }

    // 内部类 发动机
    class Engine {
        String engineName;
        int engineAge;

        public void show(){
            System.out.println(engineName);
            System.out.println(carName);
        }
    }
}
